{% extends 'template.html' %}

{% block username %}
    {{ head.username }}
{% endblock %}

{% block content %}
    <div id="page-wrapper">
        <div class="row">
            <div class="col-lg-12">
                <h1 class="page-header">执行 salt 命令</h1>
                <input style="display: none" value="{{ uuid }}" id="execute_command_uuid">
            </div>
        </div>
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-default">
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-lg-6">
                                <div class="container">
                                    <div class="form-group row">
                                        <label class="col-lg-12">输入 salt 命令</label>
                                        <div class="col-lg-6">
                                            <input class="form-control" placeholder="salt '*' cmd.run 'df -h'"
                                                   id="salt_command">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <div class="col-lg-12">
                                            <button class="btn btn-primary" id="submit_command">提交</button>
                                            <a class="btn btn-success" href="/assets/salt_command_history/" target="_blank">历史记录</a>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-lg-12" for="TextArea">输出</label>
                                    </div>
                                    <div class="panel panel-default"
                                         style="background-color: #333;height:530px;width:130%;overflow:auto">
                                        <span id="output"></span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}
{% block bodyjs %}
    <script src="/static/js/reconnecting-websocket.js"></script>
    <script src="/static/js/execute_salt_command.js?v=20190606001"></script>
{% endblock %}
